<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/31
 * Time: 15:32
 */
function getContent()
{
    $data = file_get_contents('php://input');
    $imgName = time() . 'new.jpg';
    if (file_put_contents($imgName, $data)) {
        echo  'ok';
    } else {
        echo  'error';
    }
}
getContent();